package main

import (
	"sort"
	"strings"
)

func sortSentence(s string) string {
	split := strings.Split(s, " ")

	sort.Slice(split, func(i, j int) bool {
		if split[i][len(split[i])-1] < split[j][len(split[j])-1] {
			return true
		}

		return false
	})
	result := ""
	for i := 0; i < len(split); i++ {
		result += split[i][:len(split[i])-1] + " "
	}

	result = result[:len(result)-1]

	return result
}
